# coding=utf-8
from .models import NewsChannel,NewsCategory

def get_channels(request):
    '''获取导航信息'''
    channels = NewsChannel.objects.order_by('id')

    return {'channels':channels}

def get_category(request):
    '''获取类别显示'''
    # 过滤不想要的字段
    category = NewsCategory.objects.filter(channel_id='1').all()

    return {'category':category}
